import unittest

from pytexberg.front import Printer

class TestPrinter(unittest.TestCase):
	def testSplittingState(self):
		p = Printer()
		p.text("paragraph-remain-000")
		p.text("pamparam-001 uaa-002\npamparam-003\n\nthis-is-next-paragraph")
		p.text("-004\n\n")
		p.text("and-this-is-last-one-005\n\n")
		strElems = [str(e) for e in p._Printer__doc.getElements()]
		self.assertEquals(\
			[
				'Prgrph[paragraph-remain-000pamparam-001 uaa-002\npamparam-003]',
				'Prgrph[this-is-next-paragraph-004]',
#				'Prgrph[]',
				'Prgrph[and-this-is-last-one-005]',
#				'Prgrph[]'
			],
			strElems
		)
